import { Component, OnInit } from '@angular/core';

import { QuestionAnswer } from './shared/question-answer.model';
import { QuestionAnswerService } from './shared/question-answer.service';

@Component({
	selector: 'question-answer',
	templateUrl: 'question-answer.component.html',
	providers: [QuestionAnswerService]
})

export class QuestionAnswerComponent implements OnInit {
	questionAnswer: QuestionAnswer[] = [];

	constructor(private questionAnswerService: QuestionAnswerService) { }

	ngOnInit() {
		this.questionAnswerService.getList().subscribe((res) => {
			this.questionAnswer = res;
		});
	}
}